package com.wangsd.common.component.extBean;

import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import me.chanjar.weixin.common.util.xml.XStreamInitializer;

/**
 * 支付押金（人脸支付）
 */
@XStreamAlias("xml")
public class DepositOrderQueryResponse extends BaseWxPayResult {
    @XStreamAlias("transaction_id")
    private String transactionId;

    @XStreamAlias("out_order_no")
    private String outOrderNo;

    @XStreamAlias("time_end")
    private String timeEnd;

    @XStreamAlias("cash_fee")
    private String cashFee;

    @XStreamAlias("total_fee")
    private String totalFee;

    @XStreamAlias("coupon_fee")
    private String couponFee;

    @XStreamAlias("trade_type")
    private String tradeType;

    @XStreamAlias("settlement_total_fee")
    private String settlementTotalFee;

    @XStreamAlias("openid")
    private String openid;


    /**
     * NOTPAY—未支付
     * USERPAYING--用户支付中
     * PAYERROR--支付失败
     * SUCCESS?支付成功，资金冻结中
     * REVOKED—已撤销
     * SETTLING—押金消费已受理
     * SETTLEMENTFAIL ?押金解除冻结失败
     * CONSUMED—押金消费成功
     */
    @XStreamAlias("trade_state")
    private String tradeState;

    public static DepositOrderQueryResponse fromXML(String xmlString) {
        XStream xstream = XStreamInitializer.getInstance();
        xstream.allowTypesByWildcard(new String[]{"me.chanjar.weixin.**",
                "cn.binarywang.wx.**", "com.github.binarywang.**",
                "com.wangsd.common.component.**"});
        xstream.processAnnotations(DepositOrderQueryResponse.class);
        DepositOrderQueryResponse result = (DepositOrderQueryResponse) xstream.fromXML(xmlString);
        result.setXmlString(xmlString);
        return result;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getOutOrderNo() {
        return outOrderNo;
    }

    public void setOutOrderNo(String outOrderNo) {
        this.outOrderNo = outOrderNo;
    }

    public String getTimeEnd() {
        return timeEnd;
    }

    public void setTimeEnd(String timeEnd) {
        this.timeEnd = timeEnd;
    }

    public String getCashFee() {
        return cashFee;
    }

    public void setCashFee(String cashFee) {
        this.cashFee = cashFee;
    }

    public String getTotalFee() {
        return totalFee;
    }

    public void setTotalFee(String totalFee) {
        this.totalFee = totalFee;
    }

    public String getTradeType() {
        return tradeType;
    }

    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getTradeState() {
        return tradeState;
    }

    public void setTradeState(String tradeState) {
        this.tradeState = tradeState;
    }

    public String getSettlementTotalFee() {
        return settlementTotalFee;
    }

    public void setSettlementTotalFee(String settlementTotalFee) {
        this.settlementTotalFee = settlementTotalFee;
    }

    public String getCouponFee() {
        return couponFee;
    }

    public void setCouponFee(String couponFee) {
        this.couponFee = couponFee;
    }
}
